/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package util;

import javax.mail.*;

/**
 *
 * @author Zhang Ying
 */
public class SMTPAuthenticator extends javax.mail.Authenticator {

    private String smtpAuthUser;
    private String smtpPassword;

    public SMTPAuthenticator() {
    }

    public SMTPAuthenticator(String user, String pwd) {
        this.smtpAuthUser = user;
        this.smtpPassword = pwd;
    }

    @Override
    public PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(smtpAuthUser, smtpPassword);
    }
}
